using System;
using System.Collections.Generic;

namespace Managistics.Model
{
    [Serializable()]
    public class OutputSheetDetail : Entity<double>
    {
        private string _outputSheetId;
        private string _itemId;
        private OutputSheet _outputSheetTd;
        private Good _good;
        private float _quantityOutput;
        private string _remark;
        private int? _number;
        private double _id;
        public virtual string OutputSheetId
        {
            get
            {
                return this._outputSheetId;
            }
            set
            {
                this._outputSheetId = value;
            }
        }
        public virtual string ItemId
        {
            get
            {
                return this._itemId;
            }
            set
            {
                this._itemId = value;
            }
        }
        public virtual OutputSheet OutputSheet
        {
            get
            {
                return this._outputSheetTd;
            }
            set
            {
                this._outputSheetTd = value;
            }
        }
        public virtual Good Good
        {
            get
            {
                return this._good;
            }
            set
            {
                this._good = value;
            }
        }
        public virtual float Quantity
        {
            get
            {
                return this._quantityOutput;
            }
            set
            {
                this._quantityOutput = value;
            }
        }
        public virtual string Remark
        {
            get
            {
                return this._remark;
            }
            set
            {
                this._remark = value;
            }
        }
        public virtual int? Number
        {
            get
            {
                return this._number;
            }
            set
            {
                this._number = value;
            }
        }
        public virtual double Id
        {
            get
            {
                return this._id;
            }
            set
            {
                this._id = value;
            }
        }
        #region NHibernate Composite Key Requirements
        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            var t = obj as OutputSheetDetail;
            if (t == null) return false;
            if (OutputSheetId == t.OutputSheetId
             && ItemId == t.ItemId)
                return true;

            return false;
        }
        public override int GetHashCode()
        {
            int hash = GetType().GetHashCode();
            hash = (hash * 397) ^ OutputSheetId.GetHashCode();
            hash = (hash * 397) ^ ItemId.GetHashCode();

            return hash;
        }
        #endregion
    }

}
